// 主要是自己定义的全局组件以及vue.ant.design的组件

import Vue from 'vue'
import {
    BackTop,
    Breadcrumb,
    Button,
    Collapse,
    Cascader,
    Checkbox,
    Col,
    DatePicker,
    Dropdown,
    Form,
    Radio,
    Icon,
    Input,
    Layout,
    LocaleProvider,
    message,
    Menu,
    Modal,
    Pagination,
    Row,
    Select,
    Switch,
    Table,
    TimePicker,
    Upload,
    InputNumber
} from 'ant-design-vue'
// 暂时还没有用到的 ant-design-vue组件
// Skeleton、Spin、Anchor、ConfigProvider、Divider、Progress、Popconfirm、notification、Drawer、Alert、Tree、TreeSelect、Tooltip、Timeline、Tag、Tabs、Popover、List、Comment、
// Carousel、Card、Calendar、Badge、Avatar、Transfer、Slider、Rate、Radio、AutoComplete、Steps

// 自定义组件
import remarks from '@/components/remarks'
import date from '@/components/date'
import upload from '@/components/upload'
import confirmModal from '@/components/confirmModal'
import pagination from '@/components/pagination'
import areaSelect from '@/components/areaSelect'
import backTop from '@/components/backTop'
import exportList from '@/components/exportList'

// 在script里面需要用到的js组件
Vue.prototype.$message = message
// Vue.prototype.$notification = notification
Vue.prototype.$info = Modal.info
Vue.prototype.$success = Modal.success
Vue.prototype.$error = Modal.error
Vue.prototype.$warning = Modal.warning
Vue.prototype.$confirm = Modal.confirm

// template组件
const antComponents = [BackTop, Breadcrumb, Button, Collapse, Cascader, Checkbox, Col, DatePicker, Dropdown, Form, Radio, Icon, Input, InputNumber, Layout, LocaleProvider, message,
    Menu, Modal, Pagination, Row, Select, Switch, Table, TimePicker, Upload]

// 注册组件（vue.ant.design）
antComponents.map(item => {
    Vue.use(item)
})

// 祖册自定义组件（自己写的）
const customComponents = [remarks, date, upload, confirmModal, pagination, areaSelect, backTop, exportList]

// 注册组件（自定义组件）
customComponents.map(item => {
    Vue.component(item.name, item)
})
